home *** CD-ROM | disk | FTP | other *** search
/ Emphatic 1 / Emphatic_1_1996_Nitros.d64 / src.$a9 ifli_zzr < prev    next >
Text File  |  2023-02-26  |  3KB  |  122 lines

  1.  
  2. ;---------------------------------------
  3. ;$A9 IFLI Displayer (Funpaint II format)
  4. ;Coded by ZZR/Nitros/Virus/Nofx
  5.  
  6. ;This is the worlds smallest IFLI
  7. ;displayer! The routine is only usable
  8. ;for pic displaying, in a demo it would
  9. ;need an exact timing interupt because
  10. ;music and key pressing stuffs up the
  11. ;timing.
  12.  
  13. ;It is possible te shorten it to about
  14. ;$99 bytes by putting it on zero page
  15. ;and by doing some other changes, but
  16. ;whats the use! Anyway it is full
  17. ;relocatable and very small!
  18. ;---------------------------------------
  19.  
  20.          *= $2000
  21.  
  22.          ldx #$03
  23.          ldy #$00
  24.          sty $d021  ;Screen color
  25. get      lda $8000,y;Normal color ram
  26. put      sta $d800,y
  27.          iny
  28.          bne get
  29.          inc get+2
  30.          inc put+2
  31.          dex
  32.          bpl get
  33.  
  34.          sei        ;interupt setup
  35.          ldx #$2f
  36.          stx $dc0d
  37.          stx $d01a
  38.          stx $d012
  39.          lda #<irq
  40.          ldy #>irq
  41.          sta $0314
  42.          sty $0315
  43.          cli
  44.          bvc *
  45. ;---------------------------------------
  46.  
  47. irq      lda #$38   ;Interlace $d016
  48.          sta $d016
  49.          eor #$01
  50.          sta irq+1
  51. bank     lda #$02   ;Interlace Vic bank
  52.          sta $dd00
  53.          eor #$02
  54.          sta bank+1
  55.  
  56. ;---------------------------------------
  57.  
  58.          .byte $ab,$38
  59.  
  60. ;OAL/LAX - I have a page out of a Vic 20
  61. ;(6502) programming book (i only have 1
  62. ;page, so i don't know what it's
  63. ;called!), and it lists the illegal
  64. ;opcode $ab as OAL (ORA the accumulator
  65. ;with #$ee, AND with data and TAX). I
  66. ;think it works different on C64 (6510)
  67. ;because it just seems to LDA and LDX.
  68. ;It might bug in certain ranges (i am
  69. ;not sure), anyway it works ok in this
  70. ;situation.
  71.  
  72. ;---------------------------------------
  73.  
  74. loop     ldy #$08
  75.          sty $d018
  76.          sta $d011
  77.  
  78.          cmp ($c6,x);11 cycle timing
  79.          dec $c6    ;pause in 4 bytes!
  80.  
  81.          ldy #$18
  82.          sty $d018
  83.          inc $d011
  84.          cmp ($c6,x)
  85.          dec $c6
  86.          ldy #$28
  87.          sty $d018
  88.          inc $d011
  89.  
  90.          jsr $ff40   ;12 cycle pause in
  91.                      ;3 bytes.
  92.  
  93.          sta $cff0,y ;extra cycle + $28
  94.          inc $d011   ;which makes the
  95.          cmp ($c6,x) ;pause 13 cycles,
  96.          dec $c6     ;and stores #$38
  97.                      ;in $d018.
  98.          ldy #$48
  99.          sty $d018
  100.          inc $d011
  101.          cmp ($c6,x)
  102.          dec $c6
  103.          ldy #$58
  104.          sty $d018
  105.          inc $d011
  106.          cmp ($c6,x)
  107.          dec $c6
  108.          ldy #$68
  109.          sty $d018
  110.          inc $d011
  111.          cmp ($c6,x)
  112.          dec $c6
  113.          ldy #$78
  114.          sty $d018
  115.          inc $d011
  116.          dec $d019
  117.          dex
  118.          bpl loop
  119.  
  120.          jmp $ea81
  121.  
  122.